#include<stdio.h>

int main()
{
    FILE* fp = fopen("bite.txt","w");
    if(fp == NULL)
    {
        perror("fopen fail");
        return 1;
    }
    char str[]="linux so easy!";
    size_t num =sizeof(str)/sizeof(str[0]);
    size_t n =  fwrite(str,1,num,fp);
    fclose(fp);
    FILE* file = fopen("bite.txt","r");
    if(file == NULL)
    {
        perror("open fail");
        return 1;
    }
    // size_t fread(void *ptr, size_t size, size_t count, FILE *stream);
    char s[13];
    // fseek() 函数用于在文件中移动文件指针的位置。它的原型如下：
    // int fseek(FILE *stream, long offset, int origin);
    fseek(file, 2, SEEK_SET);
    size_t rd = fread(s,1,num,file);
    printf("%s\n",s);

    return 0;
}
